# -*- coding: utf-8 -*-

from . import main
from flask import render_template, redirect, url_for
from flask_login import login_required, current_user


@main.route('/')
def index():
    if current_user.is_anonymous:
        return redirect(url_for('auth.login'))
    return render_template('main/index.html')


@main.route('/home')
@login_required
def home():
    if current_user.is_anonymous:
        return redirect(url_for('auth.login'))
    return render_template('main/home.html', title=u'资产管理系统', pageHead=u'资源总览信息')


@main.route('/server_room')
@login_required
def server_room():
    return render_template('main/server_room.html', title=u'机房管理', pageHead=u'机房管理')
